How can I find the Nth digit? [closed]
Posted
by kokkch
on Stack Overflow
See other posts from Stack Overflow
or by kokkch
Published on 2010-04-09T19:17:38Z
Indexed on
2010/04/09
19:53 UTC
Read the original article
Hit count: 176
c
Possible Duplicate:
How to get the Nth digit of an integer with bit-wise operations?
I spent more than one day trying to solve this problem but I couldn't find a solution.
I have a function named get_nth_digit(int x, int pos);
.
int x
is a number given by the user, int pos
is the number that represents the position of the digit in the number x
the user wants to get.
How can I do this? Can anyone help?
© Stack Overflow or respective owner